import mplfinance as mpf
# 设置mplfinance的蜡烛颜色，up为阳线颜色，down为阴线颜色
my_color = mpf.make_marketcolors(up='r',
                                 down='g',
                                 edge='inherit',
                                 wick='inherit',
                                 volume='inherit')
# 设置图表的背景色
my_style = mpf.make_mpf_style(marketcolors=my_color,
                              figcolor='(0.82, 0.83, 0.85)',
                              gridcolor='(0.82, 0.83, 0.85)')


import pandas as pd
from lib.StockDataFetcher import StockDataFetcher

fetcher = StockDataFetcher('000737',start_date='2024-06-01',forced_update=False)

# print(df.columns) # trade_time', 'open', 'close', 'volume', 'high', 'low', 'amount', 'change', 'change_pct', 'turnover_ratio', 'pre_close', 'stock_code','trade_date'

df = fetcher.fetch_or_load_data()[['trade_date', 'open', 'close', 'high', 'low','volume']]
df = df.rename(columns={'trade_date': 'Date', 'open': 'Open', 'close': 'Close', 'high': 'High', 'low': 'Low','volume': 'Volume'})

